package com.pzl.login;

import android.os.Bundle;
import android.view.View;
import android.widget.ImageView;
import android.widget.Toast;

import androidx.appcompat.app.AppCompatActivity;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;
import com.pzl.basic.beans.User;
import com.pzl.common.utils.ImageUtil;

@Route(path = "/login/loginActivity")
public class LoginActivity extends AppCompatActivity {


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_login);

        ImageView iv = findViewById(R.id.iv);
        ImageUtil.loadDefault(this, "http://i2.tiimg.com/728217/42e91d9a99126953.png", iv);
        boolean isAppTest = BuildConfig.isAppTest;
    }


    public void click(View view) {
        int vID = view.getId();
        if (vID == R.id.btn_login) {
            Toast.makeText(LoginActivity.this, "Go to Mall component ", Toast.LENGTH_SHORT).show();
            final User user = new User("nameABC",2);
            view.postDelayed(new Runnable() {
                @Override
                public void run() {
                    ARouter.getInstance().
                            build("/mall/MallActivity").
                            withSerializable("myUser",user).
                            navigation();
                }
            }, 2000);
        }
    }

}
